<?php

use Doraemon\model\Phone;
use Biz\service\springHomeDecActivity\Util;

class UserPhoneCheckAction extends ActionPlugin
{

    const USER_LEVEL = self::LEVEL_REGISTER;

    public function main()
    {
        $lockKey = 'spring_home_dec_act:user_phone_check:' . $this->uid;
        Util::lockSubmit($lockKey);

        $result = false;
        $info = Phone::getByUid($this->uid);
        if ($info && !empty($info['phone'])) {
            $result = true;
        }
        $this->setSuccess($result);
    }
}